package com.buba.dao;

import com.buba.pojo.Employee;
import com.buba.vo.EmployeeVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Integer id);
    int insert(Employee record);
    int insertSelective(Employee record);
    Employee selectByPrimaryKey(Integer id);
    int updateByPrimaryKeySelective(Employee record);
    int updateByPrimaryKey(Employee record);

    Employee getEmpByloginnameAndloginpwd(Employee employee);

    Employee getEmpByName(String loginname);

    /**
     *todo 根据部门编号查询员工数量
     *@param deptId
     *@return
     */
    int getEmployeeCountByDeptId(Integer deptId);

    /**
     * todo 根据角色编号查询员工数量
     * @param roleId
     * @return
     */
    int getEmployeeCountByRoleId(Integer roleId);

    /**
     * 查询员工列表
     * @param employeeVO
     * @return
     */
    List<Employee> findEmployeeList(EmployeeVO employeeVO);


    /**
     * todo 添加员工
     * @param employee
     * @return
     */
    int addEmployee(Employee employee);

    /**
     * todo 修改员工
     * @param employee
     * @return
     */
    int updateEmployee(Employee employee);

    /**
     * todo 删除员工
     * @param id
     * @return
     */
    int deleteById(Integer id);

    /**
     * todo 删除员工角色关系
     * @param id
     * @return
     */
    int deleteEmployeeAndRole(Integer id);

    /**
     *todo 保存员工角色关系
     * @param roleId
     * @param empId
     */

    void addEmployeeRole(@Param("rid") String roleId, @Param("eid")  Integer empId);

}